package com.ruoyi.eval.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.eval.mapper.EvalAnswerMapper;
import com.ruoyi.eval.domain.EvalAnswer;
import com.ruoyi.eval.service.IEvalAnswerService;

/**
 * 评价应答Service业务层处理
 * 
 * @author yepanpan
 * @date 2025-05-06
 */
@Service
public class EvalAnswerServiceImpl implements IEvalAnswerService 
{
    private static final Logger log = LoggerFactory.getLogger(EvalAnswerServiceImpl.class);

    @Autowired
    private EvalAnswerMapper evalAnswerMapper;

    /**
     * 查询评价应答
     * 
     * @param id 评价应答主键
     * @return 评价应答
     */
    @Override
    public EvalAnswer selectEvalAnswerById(Long id)
    {
        return evalAnswerMapper.selectEvalAnswerById(id);
    }

    /**
     * 查询评价应答列表
     * 
     * @param evalAnswer 评价应答
     * @return 评价应答
     */
    @Override
    public List<EvalAnswer> selectEvalAnswerList(EvalAnswer evalAnswer)
    {
        return evalAnswerMapper.selectEvalAnswerList(evalAnswer);
    }

    /**
     * 新增评价应答
     * 
     * @param evalAnswer 评价应答
     * @return 结果
     */
    @Override
    public int insertEvalAnswer(EvalAnswer evalAnswer)
    {
        evalAnswer.setCreateTime(DateUtils.getNowDate());
        return evalAnswerMapper.insertEvalAnswer(evalAnswer);
    }

    /**
     * 修改评价应答
     * 
     * @param evalAnswer 评价应答
     * @return 结果
     */
    @Override
    public int updateEvalAnswer(EvalAnswer evalAnswer)
    {
        evalAnswer.setUpdateTime(DateUtils.getNowDate());
        return evalAnswerMapper.updateEvalAnswer(evalAnswer);
    }

    /**
     * 批量删除评价应答
     * 
     * @param ids 需要删除的评价应答主键
     * @return 结果
     */
    @Override
    public int deleteEvalAnswerByIds(Long[] ids)
    {
        return evalAnswerMapper.deleteEvalAnswerByIds(ids);
    }

    /**
     * 删除评价应答信息
     * 
     * @param id 评价应答主键
     * @return 结果
     */
    @Override
    public int deleteEvalAnswerById(Long id)
    {
        return evalAnswerMapper.deleteEvalAnswerById(id);
    }


}
